#!/bin/bash
source ./scripts/_functions.sh

docker-compose up -d

regex="80\/tcp -> 0\.0\.0\.0:([0-9]+)"
if [[ $(docker port mysite) =~ $regex ]]
then
    port="${BASH_REMATCH[1]}"
    echo "View the project at: http://localhost:${port}/"
fi
